<!--
 * @Description: 资料库统计
 * @Author: Huang Junjie
 * @Date: 2021-10-19 16:18:54
 * @LastEditTime: 2021-10-20 20:37:03
 * @LastEditors: Huang Junjie
-->
<template>
  <div class="content-card">
    <!-- 标题 -->
    <div class="title">
      资料库统计
      <i class="el-icon-more" />
    </div>
    <!-- 标题 -->

    <!-- 统计 -->
    <div class="num-card">
      <div class="item">
        <div class="num">46</div>
        <div>规章制度</div>
      </div>
      <div class="item">
        <div class="num">180</div>
        <div>图纸资料</div>
      </div>
      <div class="item-last">
        <div class="num">30</div>
        <div>设备台账</div>
      </div>
    </div>
    <!-- 统计 -->

    <!-- 资料库统计图表 -->
    <div
      id="ColumnChart02"
      class="echart01"
    />
    <!-- 资料库统计图表 -->
  </div>
</template>

<script>
import { ColumnChart01 } from './common/js/EchartsModel';

// 引入echarts
const echarts = require('echarts');

export default {
  name: 'DatabaseStatistics',
  data() {
    return {

    };
  },
  mounted() {
    this.getColumnChart01(); // 加载资料库统计Echarts图表
  },
  methods: {
    // 加载资料库统计Echarts图表
    getColumnChart01() {
      const xAxisData = ['供电示意图', '平面布置图', '设备安装图', '二次接线图', '作业指导书'];
      const seriesData = [300, 350, 280, 150, 220];
      const myChart = echarts.init(document.getElementById('ColumnChart02'));
      ColumnChart01(myChart, xAxisData, seriesData); // 资料库统计 - 柱状图
    }
  }
};
</script>

<style lang="scss" scoped>
.content-card {
  width: 355px;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid #ebebeb;
  .title {
    color: #666666;
    padding: 5px 0 5px 10px;
    font-weight: 600;
    border-bottom: 1px solid #ebebeb;
    .el-icon-more {
      color: #676767;
      float: right;
      margin-right: 10px;
      cursor: pointer;
    }
    .el-icon-more:hover {
      color: #54B2FC;
      float: right;
      margin-right: 10px;
      cursor: pointer;
    }
  }
  .num-card {
    font-size: 14px;
    color: #676767;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 0;
    .item {
      padding: 0 8px;
      line-height: 22px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-right: 1px solid #ebebeb;
      .num {
        margin-right: 10px;
        color: #666666;
        font-size: 20px;
        font-weight: 600;
      }
      .num:hover {
        color: #54B2FC;
        text-decoration: underline;
        cursor: pointer;
        font-weight: 600;
      }
    }
    .item-last {
      padding: 0 10px;
      line-height: 22px;
      display: flex;
      align-items: center;
      justify-content: center;
      .num {
        margin-right: 10px;
        color: #666666;
        font-size: 20px;
        font-weight: 600;
      }
      .num:hover {
        color: #54B2FC;
        text-decoration: underline;
        cursor: pointer;
        font-weight: 600;
      }
    }
  }
  .echart01 {
    width: 355px;
    height: 200px;
    margin: 0 auto;
  }
}
</style>
